#include <stdio.h>
#include <string.h>
#include <stdlib.h>


int* twoSum(int* nums, int numsSize, int target, int* returnSize);

int lengthOfLongestSubstring(char * s);

int main(int argc,char **argv)
{



	/**int *pr=NULL;
	int returnSize;
	int arr[3]={3,2,4};

	pr=twoSum(arr,sizeof(arr)/sizeof(int),6,&returnSize);


	printf("\n%d,%d",pr[0],pr[1]);

	*/


	printf("\n%d",lengthOfLongestSubstring(*(argv+1)));


	return 0;
}



/**
int* twoSum(int* nums, int numsSize, int target, int* returnSize){

    int i=0;
    int j=0;
    int *r=(int *)malloc(sizeof(int) *2);
    *returnSize=2;

    for(;i<numsSize;i++)
    {
        for(j=0;j<numsSize;j++)
        {
            if(i==j){
                continue;
            }

		printf("\ncal %d,%d",nums[i],nums[j]);
            if(nums[i]+nums[j]==target){
                r[0]=i;
                r[1]=j;
                return r;
            }

        }


    }
    return r;
}



struct ListNode* addTwoNumbers(struct ListNode* l1, struct ListNode* l2){

    struct ListNode *pNode1=l1;
    struct ListNode *pNode2=l2;
    int j=0,i=0;
    while(pNode1!=NULL&&pNode2!=NULL)
    {

        i=pNode1->val+pNode2->val+j;

        pNode1->val=i%10;

        j=i/10;
        pNode2=pNode2->next;
        pNode1=pNode1->next;
    }
    return l1;
}

**/
int lengthOfLongestSubstring(char * s){

    
    int r=0;
    
    int max=0;
    char lc=0;
    char *p=s;
    
    while(*p)
    {
        
        if(*p!=lc)
        {
            r++;
        }else{
            
            if(r>max){
                max=r;
            }
            r=1;
        }
        
       lc=*p; 
        
        p++;
    }
    
     if(r>max){
      
         max=r;
     }
    
    return max;
}


